<?php
class Cookie
{
    const prefix = 'ibuy_';
    
    public function set($key, $value, $expire = 2592000)
    {
        setcookie(self::_getKey($key), $value, time() + $expire, "/", "");        
    }
    
    private function _getKey($key)
    {
        return Cookie::prefix . $key;
    } 
    
    public function get($key)
    {
        if(isset($_COOKIE[self::_getKey($key)]))
        {
            return $_COOKIE[self::_getKey($key)];
        }
        return false;
    }
}